package tmproject.hlhj.fhp.cartrans.presenter

import android.content.Context
import com.example.mymvp.BasePresenter
import tmproject.hlhj.fhp.cartrans.IView.RegisView
import tmproject.hlhj.fhp.cartrans.javaBean.BaseBean
import tmproject.hlhj.fhp.cartrans.javaBean.CarNumBean
import tmproject.hlhj.fhp.cartrans.javaBean.RegisBean
import tmproject.hlhj.fhp.cartrans.modules.RegisModule
import java.io.File

/**
 * Created by Administrator on 2018/8/11/011.
 */
class RegisPresenter :BasePresenter<RegisModule,RegisView>(), RegisModule.RegisResp {
    override fun onRegisResult(regisBean: RegisBean) {
        view?.regisResp(regisBean)
    }

    override fun onCarNumResult(carNumBean: CarNumBean) {
        view?.carNumResp(carNumBean)
    }
    fun getCarNum(c: Context){
        module.getCarNum(c)
    }
    fun regis(c: Context, name:String, mobile:String, sex:String, age:Int, id_no:String
              , jsz_expire_date:String, zgz_expire_date:String, tractor_id:String, id_pic: File, id_pic_back: File
              , jsz_pic: File, zgz_pic: File){
        module.tryRegis(c, name, mobile, sex, age, id_no, jsz_expire_date, zgz_expire_date, tractor_id, id_pic, id_pic_back, jsz_pic, zgz_pic)
    }
    override fun createModule() {
        module= RegisModule()
        module.listener=this
    }
}